#ifndef VECTOR_H
#define VECTOR_H

#include <math.h>

class Vector
{
	public:
		// Constructors
		inline Vector() : x(0), y(0), z(0) { }
		inline Vector(float xVal, float yVal, float zVal) : x(xVal), y(yVal), z(zVal) { }
		inline ~Vector() { }
		
		// Accessors
		inline float getX() { return x; }
		inline float getY() { return y; }
		inline float getZ() { return z; }
		
		// Mutators
		inline void setX(float xVal) { x = xVal; }
		inline void setY(float yVal) { y = yVal; }
		inline void setZ(float zVal) { z = zVal; }
		
		// operators
		void operator += (const Vector& vector);
		Vector operator + (const Vector& vector) const;
		void operator -= (const Vector& vector);
		Vector operator - (const Vector& vector) const;
		void operator *= (const float value);
		Vector operator * (const float value) const;
		float operator * (const Vector& vector) const;
		Vector operator /= (const float value);
		Vector operator / (const float value) const;
		
		// Standard object maintenence
		Vector &operator = (const Vector &vector);
		bool operator == (const Vector& vector) const;
		bool operator != (const Vector& vector) const;
		bool operator < (const Vector& vector) const;
		bool operator > (const Vector& vector) const;
		bool operator <= (const Vector& vector) const;
		bool operator >= (const Vector& vector) const;
		
		// Vector Specific Functions.
		float magnitude() const;
		float magnitudeSquared() const;
		void normalise();
		Vector unit() const;
		inline void zero() { x = 0; y = 0; z = 0; }
		Vector crossProduct(const Vector &a, const Vector &b);
		float distance(const Vector &pointA, const Vector &pointB);
		float distanceSquared(const Vector &pointA, const Vector &pointB);
		inline void invert() { x = -x; y = -y; z = -z; }
		
	public:
		float x;
		float y;
		float z;
};

extern const Vector kZeroVector;

#endif VECTOR_H